#### Alert information
# Alert Details
sasaml.alert.sql= SELECT DISTINCT A.alert_id, A.alert_description, A.primary_entity_level_code, A.primary_entity_key,
A.scenario_id, A.money_laundering_risk_score, A.terror_financing_risk_score, A.run_date, A.create_date, A.alert_status_code,
A.primary_entity_name, A.actual_values_text, lov.lov_type_desc, A.primary_entity_number, A.scenario_name, E.event_description,
E.create_date as event_date, A.create_user_id as create_user_id, A.owner_user_long_id as owner_user_long_id,
A.alert_type_cd as alert_type_cd, A.alert_category_cd as alert_category_cd, A.alert_subcategory_cd as alert_subcategory_cd
FROM fsk_alert A LEFT JOIN FSK_SCENARIO S
ON A.scenario_id = S.scenario_id
LEFT JOIN fsk_lov lov
ON s.scenario_category_code = lov.lov_type_code AND lov.lov_type_name = 'SCENARIO CATEGORY'
LEFT JOIN (SELECT alert_id,event_description,create_date FROM fsk_alert_event WHERE alert_id = ? AND event_type_code = 'CLS') E
ON A.alert_id = E.alert_id WHERE A.alert_id = ?
GROUP BY A.alert_id, A.alert_description, A.primary_entity_level_code, A.primary_entity_key, A.scenario_id,
A.money_laundering_risk_score, A.terror_financing_risk_score, A.run_date, A.create_date, A.alert_status_code,
A.primary_entity_name, A.actual_values_text, lov.lov_type_desc, A.primary_entity_number, A.scenario_name,
E.event_description, E.create_date, A.create_user_id, A.owner_user_long_id, A.alert_type_cd, A.alert_category_cd,
A.alert_subcategory_cd
ORDER BY E.CREATE_DATE DESC